3 click centering monitor now starts with waiting for three click#368
3 click centering monitor now starts with waiting for three click#368NYSBC-Rudra wants to merge 9 commits intoNSLS2:md2-raster-2024-1from
Conversation
| def center3LoopCB(self): | ||
| logger.info("3-click center loop") | ||
| self.threeClickCount = 1 | ||
| self.threeClickSignal.emit('{} more clicks'.format(str(4-self.threeClickCount))) |
There was a problem hiding this comment.
I would suggest using f strings see section 7.1.1 - https://docs.python.org/3/tutorial/inputoutput.html . the text to emit would look like '{4-self.threeClickCount} more clicks'
|
|
||
| def processBeamAvailable(self, beamAvailVal): | ||
| if int(beamAvailVal) == 1: | ||
| ''' |
There was a problem hiding this comment.
beam available is supposed to be a global signal of whether the sample would be exposed to X-rays if the shutter were open, regardless of what the user is doing on the GUI.
| correctedC2C_x = correctedC2C_x * scale_x | ||
| correctedC2C_y = correctedC2C_y * scale_y | ||
| self.md2.centring_click.put(f"{correctedC2C_x} {correctedC2C_y}") | ||
| #logger.info('waiting for motor rotation') |
There was a problem hiding this comment.
remove commented-out text - if necessary, use git history to retrieve it, unless it is likely to be used soon
| gripTempSignal = QtCore.Signal(float) | ||
| ringCurrentSignal = QtCore.Signal(float) | ||
| beamAvailableSignal = QtCore.Signal(float) | ||
| threeClickSignal = QtCore.Signal(str) |
There was a problem hiding this comment.
since it looks like the beam available GUI feature is being replaced with three-click, I suggest using a completely new GUI object instead of re-using an old one. Re-using items with the same name is going to be difficult to debug in the feature than if it is correctly named.
| ''' | ||
| def omegaMoveCheck(self, sleeptime,call='OmegaState'): | ||
| state = self.md2.exporter.read(call) | ||
| while(state == 'Moving'): |
There was a problem hiding this comment.
if these kinds of checks are going to be done in multiple areas of the code, I suggest moving the function into a more central place and have the states as enums or constants (like things in config_params.py) so that small issues such as wrong comparison of strings ("string" != "String") don't lead to functional issues.
Thought I was just adding line 1441 but hopefully this will still work